﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Cryptography;
using System.Net.Mail;
using System.Net.Configuration;
using System.Net;
using System.Configuration;
//using System.Security.Cryptography;
using System.Web.Configuration;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;

namespace SCSService
{
    public class BaseService
    {
        private string[] onesMapping =
          new string[] {
                    "Không", "Một", "Hai", "Ba", "Bốn", "Năm", "Sáu", "Bảy", "Tám", "Chín"
                };
        private static string[] tensMapping =
            new string[] {
                    "Mười","Hai Mươi", "Ba mươi", "Bốn mươi", "Năm mươi", "Sáu mươi", "Bảy mươi", "Tám mươi", "Chín mươi"
                };
        private static string[] groupMapping =
            new string[] {
                   "Trăm", "Nghìn","Triệu", "Tỉ", "Nghìn", "Triệu", "Tỉ", "Nghìn", "Triệu", "Tỉ"
                };

        public string EnMD5(string Value)
        {
            MD5CryptoServiceProvider md5 = new MD5CryptoServiceProvider();
            UTF8Encoding encode = new UTF8Encoding();
            byte[] valueArray;
            valueArray = md5.ComputeHash(encode.GetBytes(Value));
            string encrypted = "";
            for (int i = 0; i < valueArray.Length; i++)
                encrypted += valueArray[i].ToString("x2").ToLower();
            return encrypted;
        }

        public string RandomString(int size, bool lowerCase)
        {
            StringBuilder builder = new StringBuilder();
            Random random = new Random();
            char ch;
            for (int i = 0; i < size; i++)
            {
                ch = Convert.ToChar(Convert.ToInt32(Math.Floor(26 * random.NextDouble() + 65)));
                builder.Append(ch);
            }
            if (lowerCase)
                return builder.ToString().ToLower();
            return builder.ToString();
        }

        public int RandomNumber(int min, int max)
        {
            Random random = new Random();
            return random.Next(min, max);
        }

        public string GetCodeRamdom()
        {
            StringBuilder builder = new StringBuilder();
            builder.Append(RandomString(2, true));
            builder.Append(RandomNumber(100000, 999999));
            return builder.ToString();
        }

        public void SendEmailForgotPassword(string email, string pass)
        {
            Configuration configurationFile =WebConfigurationManager.OpenWebConfiguration(System.Web.HttpContext.Current.Request.ApplicationPath);

            MailSettingsSectionGroup mailSettings = configurationFile.GetSectionGroup("system.net/mailSettings") as MailSettingsSectionGroup;
            int port = 0;
            string host = "";
            string password = "";
            string username = "";
            string from = "";

            if (mailSettings != null)
            {
                port = mailSettings.Smtp.Network.Port;
                host = mailSettings.Smtp.Network.Host;
                password = mailSettings.Smtp.Network.Password;
                username = mailSettings.Smtp.Network.UserName;
                from = mailSettings.Smtp.From;
            }

            MailMessage msg = new MailMessage();

            msg.To.Add(email);

            msg.From = new System.Net.Mail.MailAddress(from, "We Company", Encoding.UTF8);
            msg.Subject = "We Company";
            msg.SubjectEncoding = System.Text.Encoding.UTF8;
            msg.Body = "Your Password : " + "<br/>" + "<b>" + pass + "</b>";
            msg.BodyEncoding = System.Text.Encoding.UTF8;
            msg.IsBodyHtml = true;
            msg.Priority = System.Net.Mail.MailPriority.High;

            //Add the Creddentials

            SmtpClient client = new SmtpClient(host, port);
            client.Credentials = new NetworkCredential(username, password);//dat vao file config        
            client.EnableSsl = true;

            try
            {
                client.Send(msg);
                //Response.Write("Send Mail OK");
            }
            catch (System.Net.Mail.SmtpException ex)
            {
                Console.Write(ex);
                //Response.Write("Send Mail Error: " + ex.Message);
            }
        }

        public bool SendMailMessage(string ToEmail, string Subject, string Content,string NameCus,string CompanyCus,string AddressCus,string PhoneCus,string emailCus)
        {
            Configuration configurationFile = WebConfigurationManager.OpenWebConfiguration(System.Web.HttpContext.Current.Request.ApplicationPath);

            MailSettingsSectionGroup mailSettings = configurationFile.GetSectionGroup("system.net/mailSettings") as MailSettingsSectionGroup;
            int port = 0;
            string host = "";
            string password = "";
            string username = "";
            string from = "";

            if (mailSettings != null)
            {
                port = mailSettings.Smtp.Network.Port;
                host = mailSettings.Smtp.Network.Host;
                password = mailSettings.Smtp.Network.Password;
                username = mailSettings.Smtp.Network.UserName;
                from = mailSettings.Smtp.From;
            }

            MailMessage mail = new MailMessage();
            mail.From = new MailAddress(from, "comment", System.Text.Encoding.UTF8);
            mail.To.Add(ToEmail);
            mail.SubjectEncoding = System.Text.Encoding.UTF8;
            mail.Subject = Subject;
            mail.BodyEncoding = System.Text.Encoding.UTF8;
            mail.IsBodyHtml = true;

            string html = Content + "<br/>" + "---------------------------------" + "<br/>" + "Name :" + NameCus + "<br/>" + "Address :" + AddressCus + "<br/>" + "Company :" + CompanyCus + "<br/>" + "Phone :" + PhoneCus + "<br/>" + "Email :" + emailCus + "<br/>" + "---------------------------------";
            mail.Body = html;
            mail.Priority = System.Net.Mail.MailPriority.High;

            
            try
            {

                SmtpClient smtp = new SmtpClient(host, port);
                smtp.Credentials = new NetworkCredential(username, password);
                smtp.EnableSsl = true;

                smtp.Send(mail);

                return true;

            }
            catch (Exception)
            {
                return false;

            }

        }

        public bool SendMailMessageforRegisterWebshop(string ToEmail, string Subject, string Content, string NameCus, string CompanyCus, string AddressCus, string PhoneCus, string emailCus)
        {
            Configuration configurationFile = WebConfigurationManager.OpenWebConfiguration(System.Web.HttpContext.Current.Request.ApplicationPath);

            MailSettingsSectionGroup mailSettings = configurationFile.GetSectionGroup("system.net/mailSettings") as MailSettingsSectionGroup;
            int port = 0;
            string host = "";
            string password = "";
            string username = "";
            string from = "";

            if (mailSettings != null)
            {
                port = mailSettings.Smtp.Network.Port;
                host = mailSettings.Smtp.Network.Host;
                password = mailSettings.Smtp.Network.Password;
                username = mailSettings.Smtp.Network.UserName;
                from = mailSettings.Smtp.From;
            }

            MailMessage mail = new MailMessage();
            mail.From = new MailAddress(from, "ATF proshop", System.Text.Encoding.UTF8);
            mail.To.Add(ToEmail);
            mail.SubjectEncoding = System.Text.Encoding.UTF8;
            mail.Subject = "Thông báo khởi tạo website trên hệ thống ATF proshop";
            mail.BodyEncoding = System.Text.Encoding.UTF8;
            mail.IsBodyHtml = true;

            string html = Content;
            mail.Body = html;
            mail.Priority = System.Net.Mail.MailPriority.High;


            try
            {

                SmtpClient smtp = new SmtpClient(host, port);
                smtp.Credentials = new NetworkCredential(username, password);
                smtp.EnableSsl = true;

                smtp.Send(mail);

                return true;

            }
            catch (Exception)
            {
                return false;

            }

        }

        public virtual string convertNumberToChar(int number)
        {
            return convertNumberToChar((long)number);
        }

        public virtual string convertNumberToChar(long number)
        {
            //if (number == 0)
            //{
            //    return onesMapping[number];
            //}

            //string sign = string.Empty;
            //if (number < 0)
            //{
            //    sign = "Âm";
            //    number = Math.Abs(number);
            //}

            //string retVal = null;
            //int group = 0;
            //while (number > 0)
            //{
            //    int numberToProcess = (int)(number % 1000);
            //    number = number / 1000;

            //    string groupDescription = ProcessGroup(numberToProcess);
            //    if (groupDescription != null)
            //    {
            //        if (group > 0)
            //        {
            //            retVal = groupMapping[group] + " " + retVal;
            //        }
            //        retVal = groupDescription + " " + retVal;
            //    }
            //    group++;
            //}

            string sign = string.Empty;
            if (number < 0)
            {
                sign = "Âm";
                number = Math.Abs(number);
            }
            string retVal = null;
            retVal = convertNumberToChar(number.ToString());
            return sign + " " + retVal;
        }

        private string ProcessGroup(int number)
        {
            int tens = number % 100;
            int hundreds = number / 100;

            string retVal = null;
            if (hundreds > 0)
            {
                retVal = onesMapping[hundreds] + " " + groupMapping[0];
            }
            if (tens > 0)
            {
                if (tens < 10)
                {
                    retVal += ((retVal != null) ? " Lẻ " : string.Empty) + onesMapping[tens];
                }
                else
                {
                    int ones = tens % 10;
                    tens = (tens / 10) - 1; // 20's offset

                    retVal += ((retVal != null) ? " " : string.Empty) + tensMapping[tens];

                    if (ones > 0)
                    {
                        retVal += ((retVal != null) ? " " : string.Empty) + onesMapping[ones];
                    }
                }
            }
            return retVal;
        }

        public virtual string convertNumberToChar(string s)
        {
            string[] so = {"không", "một", "hai", "ba", "bốn", "năm", "sáu", "bảy", "tám", "chín"
             };
            string[] hang = { string.Empty, "nghìn", "triệu", "tỉ" };

            int i;
            int j;
            int donvi;
            int chuc;
            int tram;
            string str;
            str = string.Empty;
            i = s.Length;
            if (s == "0")
            {
                return "không";
            }
            ///''''
            i = s.Length;
            if (i == 0)
            {
                str = string.Empty;
            }
            else
            {
                j = 0;
                while (i > 0)
                {
                    donvi = Int32.Parse(s.Substring(i - 1, 1));
                    i = i - 1;
                    if (i > 0)
                    {
                        chuc = Int32.Parse(s.Substring(i - 1, 1));
                    }
                    else
                    {
                        chuc = -1;
                    }
                    i = i - 1;
                    if (i > 0)
                    {
                        tram = Int32.Parse(s.Substring(i - 1, 1));
                    }
                    else
                    {
                        tram = -1;
                    }
                    i = i - 1;
                    if (donvi > 0 | chuc > 0 | tram > 0 | j == 3)
                    {
                        str = hang[j] + " " + str;
                    }
                    j = j + 1;
                    if (j > 3)
                    {
                        j = 1;
                    }
                    if (donvi == 1 & chuc > 1)
                    {
                        str = "mốt" + " " + str;
                    }
                    else
                    {
                        if (donvi == 5 & chuc > 0)
                        {
                            str = "lăm" + " " + str;
                        }
                        else if (donvi > 0)
                        {
                            str = so[donvi] + " " + str;
                        }
                    }
                    if (chuc < 0)
                    {
                        break;
                    }
                    else
                    {
                        if (chuc == 0 & donvi > 0)
                        {
                            str = "lẻ" + " " + str;
                        }
                        else if (chuc == 1)
                        {
                            str = "mười" + " " + str;
                        }
                        else if (chuc > 1)
                        {
                            str = so[chuc] + " " + "mươi" + " " + str;
                        }
                    }
                    if (tram < 0)
                    {
                        break;
                    }
                    else
                    {
                        if (tram > 0 | chuc > 0 | donvi > 0)
                        {
                            str = so[tram] + " " + "trăm" + " " + str;
                        }
                    }
                }
            }
            return str.Trim();
        }

        public string cutString(string input, int characterLimit)
        {
            string output = input;
            if (output.Length > characterLimit && characterLimit > 0)
            {
                output = output.Substring(0, characterLimit);
                if (input.Substring(output.Length, 1) != " ")
                {
                    int LastSpace = output.LastIndexOf(" ");
                    if (LastSpace != -1)
                    {
                        output =
                            output.Substring(0, LastSpace);
                    }
                }
                output += "...";
            }
            return output;
        } 

        public virtual string ConvertString(string value) // Chuyển có dấu thành không dấu
        {
            value = value.Replace(':', ' ');
            value = value.Replace('/', ' ');

            value = value.Replace('\"', ' ');
            value = value.Replace('\"', ' ');
            value = value.Replace('%', ' ');
            value = value.Replace('@', ' ');
            value = value.Replace('$', ' ');
            value = value.Replace('#', ' ');
            value = value.Replace('^', ' ');
            value = value.Replace('&', ' ');
            value = value.Replace('!', ' ');
            value = value.Replace('*', ' ');

            value = value.Replace("ấ", "a");
            value = value.Replace("ầ", "a");
            value = value.Replace("ẩ", "a");
            value = value.Replace("ẫ", "a");
            value = value.Replace("ậ", "a");

            value = value.Replace("Ấ", "A");
            value = value.Replace("Ầ", "A");
            value = value.Replace("Ẩ", "A");
            value = value.Replace("Ẫ", "A");
            value = value.Replace("Ậ", "A");

            value = value.Replace("ắ", "a");
            value = value.Replace("ằ", "a");
            value = value.Replace("ẳ", "a");
            value = value.Replace("ẵ", "a");
            value = value.Replace("ặ", "a");

            value = value.Replace("Ắ", "A");
            value = value.Replace("Ằ", "A");
            value = value.Replace("Ẳ", "A");
            value = value.Replace("Ẵ", "A");
            value = value.Replace("Ặ", "A");

            value = value.Replace("á", "a");
            value = value.Replace("à", "a");
            value = value.Replace("ả", "a");
            value = value.Replace("ã", "a");
            value = value.Replace("ạ", "a");
            value = value.Replace("â", "a");
            value = value.Replace("ă", "a");

            value = value.Replace("Á", "A");
            value = value.Replace("À", "A");
            value = value.Replace("Ả", "A");
            value = value.Replace("Ã", "A");
            value = value.Replace("Ạ", "A");
            value = value.Replace("Â", "A");
            value = value.Replace("Ă", "A");

            value = value.Replace("ế", "e");
            value = value.Replace("ề", "e");
            value = value.Replace("ể", "e");
            value = value.Replace("ễ", "e");
            value = value.Replace("ệ", "e");

            value = value.Replace("Ế", "E");
            value = value.Replace("Ề", "E");
            value = value.Replace("Ể", "E");
            value = value.Replace("Ễ", "E");
            value = value.Replace("Ệ", "E");

            value = value.Replace("é", "e");
            value = value.Replace("è", "e");
            value = value.Replace("ẻ", "e");
            value = value.Replace("ẽ", "e");
            value = value.Replace("ẹ", "e");
            value = value.Replace("ê", "e");

            value = value.Replace("É", "E");
            value = value.Replace("È", "E");
            value = value.Replace("Ẻ", "E");
            value = value.Replace("Ẽ", "E");
            value = value.Replace("Ẹ", "E");
            value = value.Replace("Ê", "E");

            value = value.Replace("í", "i");
            value = value.Replace("ì", "i");
            value = value.Replace("ỉ", "i");
            value = value.Replace("ĩ", "i");
            value = value.Replace("ị", "i");

            value = value.Replace("Í", "I");
            value = value.Replace("Ì", "I");
            value = value.Replace("Ỉ", "I");
            value = value.Replace("Ĩ", "I");
            value = value.Replace("Ị", "I");

            value = value.Replace("ố", "o");
            value = value.Replace("ồ", "o");
            value = value.Replace("ổ", "o");
            value = value.Replace("ỗ", "o");
            value = value.Replace("ộ", "o");

            value = value.Replace("Ố", "O");
            value = value.Replace("Ồ", "O");
            value = value.Replace("Ổ", "O");
            value = value.Replace("Ô", "O");
            value = value.Replace("Ộ", "O");

            value = value.Replace("ớ", "o");
            value = value.Replace("ờ", "o");
            value = value.Replace("ở", "o");
            value = value.Replace("ỡ", "o");
            value = value.Replace("ợ", "o");

            value = value.Replace("Ớ", "O");
            value = value.Replace("Ờ", "O");
            value = value.Replace("Ở", "O");
            value = value.Replace("Ỡ", "O");
            value = value.Replace("Ợ", "O");

            value = value.Replace("ứ", "u");
            value = value.Replace("ừ", "u");
            value = value.Replace("ử", "u");
            value = value.Replace("ữ", "u");
            value = value.Replace("ự", "u");

            value = value.Replace("Ứ", "U");
            value = value.Replace("Ừ", "U");
            value = value.Replace("Ử", "U");
            value = value.Replace("Ữ", "U");
            value = value.Replace("Ự", "U");

            value = value.Replace("ý", "y");
            value = value.Replace("ỳ", "y");
            value = value.Replace("ỷ", "y");
            value = value.Replace("ỹ", "y");
            value = value.Replace("ỵ", "y");

            value = value.Replace("Ý", "Y");
            value = value.Replace("Ỳ", "Y");
            value = value.Replace("Ỷ", "Y");
            value = value.Replace("Ỹ", "Y");
            value = value.Replace("Ỵ", "Y");

            value = value.Replace("Đ", "D");
            value = value.Replace("Đ", "D");
            value = value.Replace("đ", "d");

            value = value.Replace("ó", "o");
            value = value.Replace("ò", "o");
            value = value.Replace("ỏ", "o");
            value = value.Replace("õ", "o");
            value = value.Replace("ọ", "o");
            value = value.Replace("ô", "o");
            value = value.Replace("ơ", "o");

            value = value.Replace("Ó", "O");
            value = value.Replace("Ò", "O");
            value = value.Replace("Ỏ", "O");
            value = value.Replace("Õ", "O");
            value = value.Replace("Ọ", "O");
            value = value.Replace("Ô", "O");
            value = value.Replace("Ơ", "O");

            value = value.Replace("ú", "u");
            value = value.Replace("ù", "u");
            value = value.Replace("ủ", "u");
            value = value.Replace("ũ", "u");
            value = value.Replace("ụ", "u");
            value = value.Replace("ư", "u");

            value = value.Replace("Ú", "U");
            value = value.Replace("Ù", "U");
            value = value.Replace("Ủ", "U");
            value = value.Replace("Ũ", "U");
            value = value.Replace("Ụ", "U");
            value = value.Replace("Ư", "U");

            value = value.Replace(" ", "-");
            value = value.Replace(".", "-");
            value = value.Replace(",", "-");
            value = value.Replace("(", "-");
            value = value.Replace(")", "-");
            value = value.Replace("+", "-");
            value = value.Replace("=", "-");
            value = value.Replace("~", "-");
            value = value.Replace("`", "-");
            value = value.Replace("[", "-");
            value = value.Replace("]", "-");
            value = value.Replace("_", "-");
            
            return value;
        }

        public virtual string ConvertString2(string value) // Chuyển có dấu thành không dấu
        {
            value = value.Replace(':', ' ');
            value = value.Replace('/', ' ');

            value = value.Replace('\"', ' ');
            value = value.Replace('\"', ' ');
            value = value.Replace('%', ' ');
            value = value.Replace('@', ' ');
            value = value.Replace('$', ' ');
            value = value.Replace('#', ' ');
            value = value.Replace('^', ' ');
            value = value.Replace('&', ' ');
            value = value.Replace('!', ' ');
            value = value.Replace('*', ' ');

            value = value.Replace("ấ", "a");
            value = value.Replace("ầ", "a");
            value = value.Replace("ẩ", "a");
            value = value.Replace("ẫ", "a");
            value = value.Replace("ậ", "a");

            value = value.Replace("Ấ", "A");
            value = value.Replace("Ầ", "A");
            value = value.Replace("Ẩ", "A");
            value = value.Replace("Ẫ", "A");
            value = value.Replace("Ậ", "A");

            value = value.Replace("ắ", "a");
            value = value.Replace("ằ", "a");
            value = value.Replace("ẳ", "a");
            value = value.Replace("ẵ", "a");
            value = value.Replace("ặ", "a");

            value = value.Replace("Ắ", "A");
            value = value.Replace("Ằ", "A");
            value = value.Replace("Ẳ", "A");
            value = value.Replace("Ẵ", "A");
            value = value.Replace("Ặ", "A");

            value = value.Replace("á", "a");
            value = value.Replace("à", "a");
            value = value.Replace("ả", "a");
            value = value.Replace("ã", "a");
            value = value.Replace("ạ", "a");
            value = value.Replace("â", "a");
            value = value.Replace("ă", "a");

            value = value.Replace("Á", "A");
            value = value.Replace("À", "A");
            value = value.Replace("Ả", "A");
            value = value.Replace("Ã", "A");
            value = value.Replace("Ạ", "A");
            value = value.Replace("Â", "A");
            value = value.Replace("Ă", "A");

            value = value.Replace("ế", "e");
            value = value.Replace("ề", "e");
            value = value.Replace("ể", "e");
            value = value.Replace("ễ", "e");
            value = value.Replace("ệ", "e");

            value = value.Replace("Ế", "E");
            value = value.Replace("Ề", "E");
            value = value.Replace("Ể", "E");
            value = value.Replace("Ễ", "E");
            value = value.Replace("Ệ", "E");

            value = value.Replace("é", "e");
            value = value.Replace("è", "e");
            value = value.Replace("ẻ", "e");
            value = value.Replace("ẽ", "e");
            value = value.Replace("ẹ", "e");
            value = value.Replace("ê", "e");

            value = value.Replace("É", "E");
            value = value.Replace("È", "E");
            value = value.Replace("Ẻ", "E");
            value = value.Replace("Ẽ", "E");
            value = value.Replace("Ẹ", "E");
            value = value.Replace("Ê", "E");

            value = value.Replace("í", "i");
            value = value.Replace("ì", "i");
            value = value.Replace("ỉ", "i");
            value = value.Replace("ĩ", "i");
            value = value.Replace("ị", "i");

            value = value.Replace("Í", "I");
            value = value.Replace("Ì", "I");
            value = value.Replace("Ỉ", "I");
            value = value.Replace("Ĩ", "I");
            value = value.Replace("Ị", "I");

            value = value.Replace("ố", "o");
            value = value.Replace("ồ", "o");
            value = value.Replace("ổ", "o");
            value = value.Replace("ỗ", "o");
            value = value.Replace("ộ", "o");

            value = value.Replace("Ố", "O");
            value = value.Replace("Ồ", "O");
            value = value.Replace("Ổ", "O");
            value = value.Replace("Ô", "O");
            value = value.Replace("Ộ", "O");

            value = value.Replace("ớ", "o");
            value = value.Replace("ờ", "o");
            value = value.Replace("ở", "o");
            value = value.Replace("ỡ", "o");
            value = value.Replace("ợ", "o");

            value = value.Replace("Ớ", "O");
            value = value.Replace("Ờ", "O");
            value = value.Replace("Ở", "O");
            value = value.Replace("Ỡ", "O");
            value = value.Replace("Ợ", "O");

            value = value.Replace("ứ", "u");
            value = value.Replace("ừ", "u");
            value = value.Replace("ử", "u");
            value = value.Replace("ữ", "u");
            value = value.Replace("ự", "u");

            value = value.Replace("Ứ", "U");
            value = value.Replace("Ừ", "U");
            value = value.Replace("Ử", "U");
            value = value.Replace("Ữ", "U");
            value = value.Replace("Ự", "U");

            value = value.Replace("ý", "y");
            value = value.Replace("ỳ", "y");
            value = value.Replace("ỷ", "y");
            value = value.Replace("ỹ", "y");
            value = value.Replace("ỵ", "y");

            value = value.Replace("Ý", "Y");
            value = value.Replace("Ỳ", "Y");
            value = value.Replace("Ỷ", "Y");
            value = value.Replace("Ỹ", "Y");
            value = value.Replace("Ỵ", "Y");

            value = value.Replace("Đ", "D");
            value = value.Replace("Đ", "D");
            value = value.Replace("đ", "d");

            value = value.Replace("ó", "o");
            value = value.Replace("ò", "o");
            value = value.Replace("ỏ", "o");
            value = value.Replace("õ", "o");
            value = value.Replace("ọ", "o");
            value = value.Replace("ô", "o");
            value = value.Replace("ơ", "o");

            value = value.Replace("Ó", "O");
            value = value.Replace("Ò", "O");
            value = value.Replace("Ỏ", "O");
            value = value.Replace("Õ", "O");
            value = value.Replace("Ọ", "O");
            value = value.Replace("Ô", "O");
            value = value.Replace("Ơ", "O");

            value = value.Replace("ú", "u");
            value = value.Replace("ù", "u");
            value = value.Replace("ủ", "u");
            value = value.Replace("ũ", "u");
            value = value.Replace("ụ", "u");
            value = value.Replace("ư", "u");

            value = value.Replace("Ú", "U");
            value = value.Replace("Ù", "U");
            value = value.Replace("Ủ", "U");
            value = value.Replace("Ũ", "U");
            value = value.Replace("Ụ", "U");
            value = value.Replace("Ư", "U");

            value = value.Replace(" ", "-");
            value = value.Replace(",", "-");
            value = value.Replace("(", "-");
            value = value.Replace(")", "-");
            value = value.Replace("+", "-");
            value = value.Replace("=", "-");
            value = value.Replace("~", "-");
            value = value.Replace("`", "-");
            value = value.Replace("[", "-");
            value = value.Replace("]", "-");
            value = value.Replace("_", "-");

            return value;
        }
    }
}
